package com.vay.de.dang.online.ui;

import android.os.Bundle;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ScrollView;

import com.vay.de.dang.online.util.VnUIManager;

import com.vay.de.dang.online.databinding.ActivityBaseBackHomeBinding;

import cc.taylorzhang.singleclick.SingleClickUtil;

public class WithBack2Activity extends WithBack1Activity {

    private ActivityBaseBackHomeBinding binding;
    protected ScrollView mScrollView;

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public void setContentView(View view) {
        binding = ActivityBaseBackHomeBinding.inflate(getLayoutInflater());
        super.setContentView(binding.getRoot());
        binding.container.addView(view,
                new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,
                        FrameLayout.LayoutParams.WRAP_CONTENT));
        mScrollView = binding.scrollView;

        SingleClickUtil.onSingleClick(binding.bntBackHome, v -> {
            VnUIManager.closeAll();
        });

        SingleClickUtil.onSingleClick(binding.bntPre, v -> {
            onBackPressed();
        });

        SingleClickUtil.onSingleClick(binding.bntNext, v -> {
            nextActivity();
        });
    }

    protected void setTitleTv(String title) {
        binding.titleTv.setText(title);
    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    @Override
    protected void onPause() {
        super.onPause();
    }

    @Override
    public void onBackPressed() {
        super.onBackPressed();
    }

    protected void nextActivity() {

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }
}
